package com.itheima.mapper;

import com.github.pagehelper.Page;
import com.itheima.pojo.CheckItem;
import org.apache.ibatis.annotations.*;

import java.util.ArrayList;
import java.util.List;

@Mapper
public interface CheckItemMapper {
@Insert("insert into health_chuanzhi.t_checkitem(code, name, age, sex, type, price, remark, attention) "+" values (#{code},#{name},#{age},#{sex},#{type},#{price},#{remark},#{attention})")
    void additem(CheckItem checkItem);
    @Delete("delete from health_chuanzhi.t_checkitem where id=#{id}")
    void deleteByid(Long id);
//@Select("select health_chuanzhi.t_checkgroup_checkitem.checkitem_id where health_chuanzhi.t_checkgroup_checkitem.checkgroup_id=#{checkgroup_id}")
@Select("select health_chuanzhi.t_checkgroup_checkitem.checkitem_id from health_chuanzhi.t_checkgroup_checkitem where health_chuanzhi.t_checkgroup_checkitem.checkgroup_id=#{checkgroup_id}")
    ArrayList<Integer> getByGroupId(@Param("checkgroup_id") int checkgroup_id);

    void updateByItemId(CheckItem checkItem);

    Page<CheckItem> findPage(String queryString);

@Select("select  *from health_chuanzhi.t_checkitem")
    ArrayList<CheckItem> findAll();
@Select("select * from health_chuanzhi.t_checkitem where id=#{id}")
    CheckItem findById(@Param("id") int id);



//借鉴其他人的代码。。。。。。。
List<CheckItem> select(CheckItem checkItem);
}
